Change runtime dependency tracker internals to use RRIs#5541
Draft
backspace wants to merge 1 commit into
Draft
Conversation
Contributor
Host Test Results 1 files ±0 1 suites ±0 2h 35m 50s ⏱️ - 1m 56s Results for commit 33f4a6d. ± Comparison against earlier commit bb1af14. For more details on these errors, see this check. Realm Server Test Results 1 files ±0 1 suites ±0 17m 15s ⏱️ +17s Results for commit 33f4a6d. ± Comparison against earlier commit bb1af14. |
backspace
force-pushed
the
cs-12212-tracker-rri-native
branch
from
July 17, 2026 19:30
d69e92a to
bb1af14
Compare
Remove the dependencyTrackingKey / canonicalizeTrackingKey shim and let
the loader's own canonical identifier form feed the dependency tracker
directly.
The tracker previously keyed module nodes exclusively by http(s) URL:
its canonicalURL guard dropped any non-URL identifier. To bridge that,
the loader carried a dependencyTrackingKey shim that callers crossed
before tracking. That form is no longer needed — the tracker keys nodes
by the loader's canonical identifier: an RRI prefix (`@cardstack/base/X`)
for a mapped realm, the resolved real URL for a plain realm.
Two coordinated changes make direct tracking correct:
- canonicalIdentifier never emits a virtual alias. unresolveURL folds a
prefix-mapped realm onto its RRI, but the virtual alias of a plain,
prefix-less realm has no prefix to fold onto and would pass through —
leaking a virtual URL into dependency lists the index persists as real
URLs. Any such surviving alias is collapsed to its real URL via
mapURL('virtual-to-real'), which no-ops on real URLs and RRIs. The
result is an RRI for prefixed realms and the real URL for plain ones.
- normalizeModuleURL accepts an RRI prefix alongside http(s) URLs,
stripping the executable extension either way.
card-api tracks identity.module and getKnownConsumedModules deps
directly; the two loader-internal tracking sites use canonicalIdentifier.
Instance and file dependency normalization stay URL-keyed, unchanged.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
backspace
force-pushed
the
cs-12212-tracker-rri-native
branch
from
July 17, 2026 20:20
bb1af14 to
33f4a6d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is set to merge in #5540.